-
Notifications
You must be signed in to change notification settings - Fork 279
Handle pre-contest clarifications #3174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: webapp/src/Controller/API/ClarificationController.php
|
|
I would only do the warning, but include implications for the API in the message. |
So drop all other commits? I personally think keeping the UI/API uniform is an improvement. |
There are good reasons to already send the clarification, so we don't disable the feature but warn the user.
In the Jury UI we can warn with a flash message, for API we can't easily prevent automated tools from unintentionally disclosing the information. We provide both relevant times, either contest start or now to keep this easy to copy/paste. The format is already in the timezone of the contest to make sure validation passes. In theory this can still give problems in case you submit a clarification and afterwards the contest starts later, it's up to the contest admin to change the database in such cases as we don't have a reltime for clarifications.
We already disclose those in the API, so keep this consistent. This does result in the `contest time` of that clarification to be negative but thats factually true.
We allow via the API, this just makes the behaviour uniform.
It looks ugly in some cases and less professional in others where printing happened much earlier. The exact time is not relevant and could lead to discussions with teams.
We do for the jury so they can still see the interface as a time would see it.
9b278b2 to
3a60f88
Compare
| private function warnClarificationBeforeContestStart(): void | ||
| { | ||
| $cc = $this->dj->getCurrentContest(); | ||
| $message = "Generic clarifications are visible before contest start."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not just generic, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the later commits I don't disclose clarifications about problems, I know you guys had opinions on this but I think we should try the referential integrity. If we don't like the extra code path for maintainability we can discuss it now and change this message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR does many things at once, some of which can be merged easily and maybe should be lifted to their own PRs so that they can be merged already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR does many things at once, some of which can be merged easily and maybe should be lifted to their own PRs so that they can be merged already.
Which ones would you approve? I really like to close this PR soon as getting merge conflicts here is risky.
| #[MapQueryParameter] | ||
| ?string $teamto = null, | ||
| ): Response { | ||
| $this->warnClarificationBeforeContestStart(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in addition, I was thinking whether we should add a modal dialog on submission warning of the implications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this for 2 reasons... modals are more work and in case you know what you're doing this feels a little patronizing. You have more experience with judges so if you think it's smarter I can take a look how much work it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This a very edge case with some consequences, so yes, I would prefer to put into the face of the jury. Under normal operation, nobody should see the modal dialog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This a very edge case with some consequences, so yes, I would prefer to put into the face of the jury. Under normal operation, nobody should see the modal dialog.
Sounds reasonable, I'll spend the time on it.
| <h2 id="contestnotstarted" class="text-center"> | ||
| Contest {{ contest | printContestStart }} | ||
| </h2> | ||
| {% if clarifications is not empty %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking a little bit more: when do we send out "static events" in the event feed? Do we do that on state changes? Then hiding them in the API is perhaps not too much code complexity, but one would have to implement it to really see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably best described in person - @nickygerritsen, is my understanding correct that static events are created on state changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarifications are not static events. But we send them out here, so when a dependency is missing basically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, needs more thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather reject clar requests before contest start through the API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So instead of letting teams ask them via UI (because they can via API) disallow both via UI & API?
I think I'm fine with that, I want the jury to still be able to send them via API because of imports and suspected we didn't want the extra branch. I did not really like having to add this to the UI but found consistency important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is no point in asking for clarification for a contest where no data is supposed to be known yet to teams.
I want the jury to still be able to send them via API because of imports
Do we have a way to import clarifications through problem upload or what do you mean by "imports" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is no point in asking for clarification for a contest where no data is supposed to be known yet to teams.
I think can I go to the toilet is always an important one. But I'm fine with either way.. either the extra branch in the UI or the extra branch in the API.
Do we have a way to import clarifications through problem upload or what do you mean by "imports" here?
I'm not sure if we have it yet, but I think it's something we should have. In BAPC prelims (multisite over different days) the jury now updates the PDF. But I can imagine a year where we would just also upload the clars directly in case as they don't have the time.
| if ($contest !== null && $this->config->get('show_relative_time')) { | ||
| $relativeTime = $contest->getContestTime((float)$datetime); | ||
| if ($relativeTime < 0 && $squash) { | ||
| return "Before contest"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder if this makes sense in general and not just here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just display it in the table, I didn't find other locations yet (also didn't really search) but in general I agree. Probably best to move this commit out and do this in a separate PR to find the other locations.
I misunderstood what was happening, and left now individual comments on the code |
I looked into if we can let both API & UI get the data via a service (to remove having to handle everything twice) but that would require a lot of rewrites which need a bit of further thought.
The first 2 commits are unrelated, I'll open another PR for those but they broke my local build.